<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class LayoutController extends Controller
{	
	public static function daohang(){

		$cates = CateController::getCateArr(CateController::getAllCate(),0);

		return view('layout.daohang',['cates'=>$cates]);
	}

	public static function indexpro(){

		$hot = DB::table('goods')
			->where('state','2')
			->limit('4')
			->get();
		// dd($hot);
		$new = DB::table('goods')
			->where('state','1')
			->orderBy('addtime','desc')
			->limit('4')
			->get();
		$sale = DB::table('goods')
			->where('state','3')
			->limit('4')
			->get();
		$jian = DB::table('goods')
			->where('state','4')
			->limit('4')
			->get();
		return view('layout.indexPro',['hot'=>$hot,'new'=>$new,'sale'=>$sale,'jian'=>$jian]);
	}
}
